<%--
  Created by IntelliJ IDEA.
  User: soft01
  Date: 21-10-16
  Time: 下午2:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>资源详情</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/back-index.css" />
    <script src="${pageContext.request.contextPath}/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
    <style type="text/css">
        .my-video {
            margin: 30px auto auto auto;

        }
        .bgColor {
            background: black;
        }
        .padding-0 {
            padding: 0 0 !important;
        }

    </style>

    <script type="text/javascript" >
        $(function(){
            //返回资源列表
            // $("#back").on('click', function(){
            //     $('#frame-id', window.parent.document).attr('src', 'back_resourceSet.html');
            // });
            $("#back").click(function () {
                <%--console.log("${pageContext.request.contextPath}${sessionScope.showResource.path}");--%>
                console.log(${sessionScope.backbiaozhi=='1'})
                if(${sessionScope.backbiaozhi=='1'}){
                    let id=$(this).attr("resourceId");
                    location.href="${pageContext.request.contextPath}/resource/findResourceById.do?resourceId="+id;
                }else {
                    let id=$(this).attr("resourceId");
                    location.href="${pageContext.request.contextPath}/resource/findResourceByForm2.do?resourceId="+id;
                }

            })
        });
    </script>
</head>

<body>
<div class="panel panel-default" id="userSet">
    <div class="panel-heading">
        <h3 class="panel-title">资源详情</h3>
    </div>
    <div>
        <input type="button" value="返回资源列表" class="btn btn-success" id="back" resourceId="${sessionScope.showResource.id}" style="margin: 5px 15px 5px 0px;float: right;" />
    </div>
            <c:choose>
                <c:when test="${sessionScope.showResource.fileType=='.mp4'}">
                    <div style="margin-top: 40px;">
                        <div class="container-fluid padding-0 bgColor">
                    <video style="width: 100%; height:470px;" controls="controls">
                        <source src="${pageContext.request.contextPath}${sessionScope.showResource.path}"/>
                            <%--该这就行了--%>
                    </video>
                    </div>
                    </div>
                </c:when>
                <%--<c:when test="${sessionScope.showResource.fileType=='.pdf'}">--%>
                    <%--<a href="${pageContext.request.contextPath}${sessionScope.showResource.path}">点击下载pdf</a>--%>
                <%--</c:when>--%>
            </c:choose>
</div>

</body>

</html>